home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-13 | 1.4 KB | 102 lines | [TEXT/EDIT] |
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class AUX_GENERIC7HT [K -> HASHABLE,G]
-
- inherit
- AUX_GENERIC7XCT[G]
- rename
- item as item_for_iteration
- end;
- AUX_GENERIC7LL[G]
- rename
- make as ll_make,
- forth as ll_forth,
- start as ll_start,
- item as item_for_iteration,
- has as ll_has,
- go_to as ll_go_to,
- put as ll_put
- export {NONE}
- ll_make,
- ll_forth,
- ll_start,
- ll_has,
- ll_go_to,
- ll_put,
- extend
- end;
-
- creation make
-
- feature
-
- make(sz: INTEGER) is
- do
- ll_make;
- !!keys.make;
- end;
-
- put(x: G; k: K) is
- do
- extend(x);
- keys.extend(k);
- end; -- put
-
- item(k : K): G is
- local
- c: CURSOR;
- do
- from
- c := cursor;
- start;
- until
- keys.after or
- keys.item.is_equal(k)
- loop
- forth;
- end; -- loop
- if not after then
- Result := item_for_iteration;
- end;
- go_to(c);
- end; -- item
-
- key_for_iteration: K is
- do
- Result := keys.item;
- end;
-
- forth is
- do
- ll_forth;
- keys.forth;
- end; -- forth
-
- start is
- do
- ll_start;
- keys.start;
- end; -- start
-
- has (x: K): BOOLEAN is
- do
- Result := keys.has(x);
- end;
-
- go_to(c: CURSOR) is
- do
- ll_go_to(c);
- keys.go_to(c);
- end;
-
- feature {NONE}
-
- keys: AUX_GENERIC7LL[K];
-
- invariant
-
- same_count: keys.count = count;
-
- end -- AUX_GENERIC7HT
-